package factory;

import net.sf.cglib.proxy.MethodInterceptor;
import org.apache.log4j.Logger;

import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class IntermediaryMethodInterceptor implements MethodInterceptor {
    private Logger logger = Logger.getLogger(IntermediaryMethodInterceptor.class);
    @Override
    public Object intercept(Object proxy, Method method, Object[] args,MethodProxy methodProxy) throws Throwable{
        before();
        Object feedback = methodProxy.invokeSuper(Proxy,args);
        after();
        return "看房记录：买家反馈“"+feedback+"”";
    }
}
